import Vue from 'vue'
import VueRouter from 'vue-router'
import Chat from '../views/Chat.vue'
import Index from '../views/index.vue'
import Login from '../views/login/Login.vue'
import Help from '../views/help/Help.vue'
import Contact from '../views/contact/Contact.vue'
import Me from '../views/me/Me.vue'
import Complain from '../views/complain/Complain.vue'
import Register from '../views/register/Register.vue'
Vue.use(VueRouter)

  const routes = [
  {
    path: '/login',     // 路径
    name: "Login",
    component: Login    // 跳转到的组件
  },
  {
      path: '/register',     // 路径
      name: "Register",
      component: Register    // 跳转到的组件
  },
  {
    path: '/chat',
    name: 'Chat',
    component: Chat
  },
  {
    path: '/help',
    name: 'Help',
    component: Help
  },
  {
    path: '/contact',
    name: 'Contact',
    component: Contact
  },
  {
    path: '/me',
    name: 'Me',
    component: Me
  }, 
  {
    path: '/complain',
    name: 'Complain',
    component: Complain
  }, 
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
